home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / WHDload_Paket / WHDload_Demos / Concept_TuneDisk.lha / TuneDiskHD / Install-TuneDisk next >
Text File  |  2001-09-15  |  5KB  |  237 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")        ;name of the readme file
  4. (set #highs-file "highs")        ;name of high scores file
  5.  
  6. (procedure P_MakeImages
  7.  
  8.   ;the following lines must be copied and adjusted for multiple disk images
  9.  
  10.   (set #CI_disknum 1)
  11.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  12.   (set #CI_disklen 901120)
  13.   (set #CI_skiptrk -1)
  14.   (P_CreateImage)
  15.  
  16.   (set #CI_disknum 2)
  17.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  18.   (set #CI_disklen 901120)
  19.   (set #CI_skiptrk -1)
  20.   (P_CreateImage)
  21.  
  22.   (set #CI_disknum 3)
  23.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  24.   (set #CI_disklen 901120)
  25.   (set #CI_skiptrk -1)
  26.   (P_CreateImage)
  27.  
  28. )
  29.  
  30. ;****************************
  31. ;----------------------------
  32. ; checks if given program is installed, if not abort install
  33. ; #program - to check
  34.  
  35. (procedure P_ChkRun
  36.   (if
  37.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  38.     ("")
  39.     (abort 
  40.       (cat
  41.     "You must install \"" #program "\" first!\n"
  42.     "It must be accessible via the path.\n"
  43.     "You can find it in the WHDLoad package."
  44.       )
  45.     )
  46.   )
  47. )
  48.  
  49. ;----------------------------
  50. ; Create Image using DIC
  51. ; #dest        - path to save image in
  52. ; #CI_disknum  - number of the disk image to create
  53. ; #CI_diskname - label of the disk
  54. ; #CI_disklen  - length of disk image to create
  55. ; #CI_skiptrk  - track to skip, -1 means no skip
  56. ; #CI_drive    - drive to create image from
  57.  
  58. (procedure P_CreateImage
  59.   (message
  60.     (cat
  61.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  62.     "(make sure it's the right disk because it will not be checked)"
  63.     )
  64.   )
  65.   (if
  66.     (>= #CI_skiptrk 0)
  67.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  68.     (set #option "")
  69.   )
  70.   (if
  71.     (= 0
  72.       (run 
  73.         (cat
  74.           "cd \"" #dest "\"\n"
  75.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  76.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  77.         )
  78.       )
  79.     )
  80.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  81.     (abort "\"DIC\" has failed to create a diskimage")
  82.   )
  83. )
  84.  
  85. ;****************************
  86.  
  87. (if
  88.   (exists #readme-file)
  89.   (if
  90.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  91.     ("")
  92.     (run ("SYS:Utilities/More %s" #readme-file))
  93.   )
  94. )
  95.  
  96. (set #program "WHDLoad")
  97. (P_ChkRun)
  98.  
  99. (set #program "DIC")
  100. (P_ChkRun)
  101.  
  102. ; in expert mode ask for source drive
  103. (if
  104.   (= @user-level 2)
  105.   (
  106.     (set #CI_drive
  107.       (askchoice
  108.     (prompt "Select source drive for diskimages")
  109.     (default 0)
  110.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  111.     (help @askchoice-help)
  112.       )
  113.     )
  114.     (select #CI_drive
  115.       (set #CI_drive "DF0:")
  116.       (set #CI_drive "DF1:")
  117.       (set #CI_drive "RAD:")
  118.       (set #CI_drive
  119.         (askstring
  120.           (prompt "Select source drive for diskimages")
  121.           (default "DF0:")
  122.           (help @askstring-help)
  123.         )
  124.       )
  125.     )
  126.   )
  127.   (set #CI_drive "DF0:")
  128. )
  129.  
  130. (set @default-dest
  131.   (askdir
  132.     (prompt 
  133.       (cat
  134.     "Where should \"" @app-name "\" be installed?\n"
  135.     "A drawer \"" @app-name "\" will be automatically created."
  136.       )
  137.     )
  138.     (help @askdir-help)
  139.     (default @default-dest)
  140.     (disk)
  141.   )
  142. )
  143. (set #dest (tackon @default-dest @app-name))
  144. (if
  145.   (exists #dest)
  146.   (
  147.     (set #choice
  148.       (askbool
  149.         (prompt
  150.           (cat
  151.             "\nDirectory \"" #dest "\" already exists.\n"
  152.             "Should it be deleted?"
  153.           )
  154.         )
  155.         (default 1)
  156.         (choices "Delete" "Skip")
  157.         (help @askbool-help)
  158.       )
  159.     )
  160.     (if
  161.       (= #choice 1)
  162.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  163.     )
  164.   )
  165. )
  166. (makedir #dest
  167.   (help @makedir-help)
  168.   (infos)
  169. )
  170.  
  171. ;----------------------------
  172.  
  173. (copyfiles
  174.   (help @copyfiles-help)
  175.   (source ("%s.Slave" @app-name))
  176.   (dest #dest)
  177. )
  178. (if
  179.   (exists ("%s.newicon" @app-name))
  180.   (set #icon
  181.     (askchoice
  182.       (prompt "\nWhich icon would you like to install?\n")
  183.       (default 0)
  184.       (choices "Color Icon" "NewIcon")
  185.       (help @askchoice-help)
  186.     )
  187.   )
  188.   (set #icon 0)
  189. )
  190. (select #icon
  191.   (set #icon ("%s.coloricon" @app-name))
  192.   (set #icon ("%s.newicon" @app-name))
  193. )
  194. (copyfiles
  195.   (help @copyfiles-help)
  196.   (source #icon)
  197.   (newname ("%s.info" @app-name))
  198.   (dest #dest)
  199. )
  200. (if
  201.   (exists #readme-file)
  202.   (copyfiles
  203.     (help @copyfiles-help)
  204.     (source #readme-file)
  205.     (dest #dest)
  206.   )
  207. )
  208. (if
  209.   (exists ("%s.info" #readme-file))
  210.   (
  211.     (copyfiles
  212.       (help @copyfiles-help)
  213.       (source ("%s.info" #readme-file))
  214.       (dest #dest)
  215.     )
  216.     (tooltype
  217.       (dest (tackon #dest #readme-file))
  218.       (noposition)
  219.     )
  220.   )
  221. )
  222. (if
  223.   (exists #highs-file)
  224.   (copyfiles
  225.     (help @copyfiles-help)
  226.     (source #highs-file)
  227.     (dest #dest)
  228.   )
  229. )
  230.  
  231. (P_MakeImages)
  232.  
  233. ;----------------------------
  234.  
  235. (exit)
  236.  
  237.